<!DOCTYPE html>

<html>
<head>
<meta charset="UTF-8">
<link href="style.css" type="text/css" rel="stylesheet">
<title>VFIXUPIMMSS—Fix Up Special Scalar Float32 Value </title></head>
<body>
<h1>VFIXUPIMMSS—Fix Up Special Scalar Float32 Value</h1>
<table>
<tr>
<th>Opcode/Instruction</th>
<th>Op /En</th>
<th>64/32 bit Mode Support</th>
<th>CPUID Feature Flag</th>
<th>Description</th></tr>
<tr>
<td>
<p>EVEX.NDS.LIG.66.0F3A.W0 55 /r ib</p>
<p>VFIXUPIMMSS xmm1 {k1}{z}, xmm2, xmm3/m32{sae}, imm8</p></td>
<td>T1S</td>
<td>V/V</td>
<td>AVX512F</td>
<td>Fix up a float32 number in the low doubleword element in xmm2 using scalar int32 table in xmm3/m32 and store the result in xmm1.</td></tr></table>
<h3>Instruction Operand Encoding</h3>
<table>
<tr>
<td>Op/En</td>
<td>Operand 1</td>
<td>Operand 2</td>
<td>Operand 3</td>
<td>Operand 4</td></tr>
<tr>
<td>T1S</td>
<td>ModRM:reg (r, w)</td>
<td>EVEX.vvvv</td>
<td>ModRM:r/m (r)</td>
<td>Imm8</td></tr></table>
<p><strong>Description</strong></p>
<p>Perform a fix-up of the low doubleword element encoded in single-precision floating-point format in the first source operand (the second operand) using a 32-bit, two-level look-up table specified in the low doubleword element of the second source operand (the third operand) with exception reporting specifier imm8. The element that is fixed-up is selected by mask bit of 1 specified in the opmask k1. Mask bit of 0 in the opmask k1 or table response action of 0000b preserves the corresponding element of the first operand. The fixed-up element from the first source operand or the preserved element in the first operand becomes the low doubleword element of the destination operand (the first operand) Bits 127:32 of the destination operand is copied from the corresponding bits of the first source operand. The destination and first source operands are XMM registers. The second source operand can be a XMM register or a 32-bit memory location.</p>
<p>The two-level look-up table perform a fix-up of each SP FP input data in the first source operand by decoding the input data encoding into 8 token types. A response table is defined for each token type that converts the input encoding in the first source operand with one of 16 response actions.</p>
<p>This instruction is specifically intended for use in fixing up the results of arithmetic calculations involving one source so that they match the spec, although it is generally useful for fixing up the results of multiple-instruction sequences to reflect special-number inputs. For example, consider rcp(0). Input 0 to rcp, and you should get INF according to the DX10 spec. However, evaluating rcp via Newton-Raphson, where x=approx(1/0), yields an incor-rect result. To deal with this, VFIXUPIMMPD can be used after the N-R reciprocal sequence to set the result to the correct value (i.e. INF when the input is 0).</p>
<p>If MXCSR.DAZ is not set, denormal input elements in the first source operand are considered as normal inputs and do not trigger any fixup nor fault reporting.</p>
<p>Imm8 is used to set the required flags reporting. It supports #ZE and #IE fault reporting (see details below).</p>
<p>MXCSR.DAZ is used and refer to zmm2 only (i.e. zmm1 is not considered as zero in case MXCSR.DAZ is set).</p>
<p>MXCSR mask bits are ignored and are treated as if all mask bits are set to masked response). If any of the imm8 bits is set and the condition met for fault reporting, MXCSR.IE or MXCSR.ZE might be updated.</p>
<p><strong>Operation</strong></p>
<p>enum TOKEN_TYPE</p>
<p>{</p>
<p>QNAN_TOKEN (cid:197) 0,</p>
<p>SNAN_TOKEN (cid:197) 1,</p>
<p>ZERO_VALUE_TOKEN (cid:197) 2,</p>
<p>POS_ONE_VALUE_TOKEN (cid:197) 3,</p>
<p>NEG_INF_TOKEN (cid:197) 4,</p>
<p>POS_INF_TOKEN (cid:197) 5,</p>
<p>NEG_VALUE_TOKEN (cid:197) 6,</p>
<p>POS_VALUE_TOKEN (cid:197) 7</p>
<p>}</p>
<p>FIXUPIMM_SP (dest[31:0], src1[31:0],tbl3[31:0], imm8 [7:0]){</p>
<p>tsrc[31:0] (cid:197) ((src1[30:23] = 0) AND (MXCSR.DAZ =1)) ? 0.0 : src1[31:0]</p>
<p>CASE(tsrc[63:0] of TOKEN_TYPE) {</p>
<p>QNAN_TOKEN: j (cid:197) 0;</p>
<p>SNAN_TOKEN: j (cid:197) 1;</p>
<p>ZERO_VALUE_TOKEN: j (cid:197) 2;</p>
<p>POS_ONE_VALUE_TOKEN: j (cid:197) 3;</p>
<p>NEG_INF_TOKEN: j (cid:197) 4;</p>
<p>POS_INF_TOKEN: j (cid:197) 5;</p>
<p>NEG_VALUE_TOKEN: j (cid:197) 6;</p>
<p>POS_VALUE_TOKEN: j = 7;</p>
<p>}</p>
<p>; end source special CASE(tsrc…)</p>
<p>; The required response from src3 table is extracted</p>
<p>token_response[3:0] = tbl3[3+4*j:4*j];</p>
<p>CASE(token_response[3:0]) {</p>
<p>0000: dest[31:0] (cid:197) dest[31:0];</p>
<p>; preserve content of DEST</p>
<p>0001: dest[31:0] (cid:197) tsrc[31:0];</p>
<p>; pass through src1 normal input value, denormal as zero</p>
<p>0010: dest[31:0] (cid:197) QNaN(tsrc[31:0]);</p>
<p>0011: dest[31:0] (cid:197) QNAN_Indefinite;</p>
<p>0100: dest[31:0] (cid:197) -INF;</p>
<p>0101: dest[31:0] (cid:197) +INF;</p>
<p>0110: dest[31:0] (cid:197) tsrc.sign? –INF : +INF;</p>
<p>0111: dest[31:0] (cid:197) -0;</p>
<p>1000: dest[31:0] (cid:197) +0;</p>
<p>1001: dest[31:0] (cid:197) -1;</p>
<p>1010: dest[31:0] (cid:197) +1;</p>
<p>1011: dest[31:0] (cid:197) ½;</p>
<p>1100: dest[31:0] (cid:197) 90.0;</p>
<p>1101: dest[31:0] (cid:197) PI/2;</p>
<p>1110: dest[31:0] (cid:197) MAX_FLOAT;</p>
<p>1111: dest[31:0] (cid:197) -MAX_FLOAT;</p>
<p>}</p>
<p>; end of token_response CASE</p>
<p>; The required fault reporting from imm8 is extracted</p>
<p>; TOKENs are mutually exclusive and TOKENs priority defines the order.</p>
<p>; Multiple faults related to a single token can occur simultaneously.</p>
<p>IF (tsrc[31:0] of TOKEN_TYPE: ZERO_VALUE_TOKEN) AND imm8[0] then set #ZE;</p>
<p>IF (tsrc[31:0] of TOKEN_TYPE: ZERO_VALUE_TOKEN) AND imm8[1] then set #IE;</p>
<p>IF (tsrc[31:0] of TOKEN_TYPE: ONE_VALUE_TOKEN) AND imm8[2] then set #ZE;</p>
<p>IF (tsrc[31:0] of TOKEN_TYPE: ONE_VALUE_TOKEN) AND imm8[3] then set #IE;</p>
<p>IF (tsrc[31:0] of TOKEN_TYPE: SNAN_TOKEN) AND imm8[4] then set #IE;</p>
<p>IF (tsrc[31:0] of TOKEN_TYPE: NEG_INF_TOKEN) AND imm8[5] then set #IE;</p>
<p>IF (tsrc[31:0] of TOKEN_TYPE: NEG_VALUE_TOKEN) AND imm8[6] then set #IE;</p>
<p>IF (tsrc[31:0] of TOKEN_TYPE: POS_INF_TOKEN) AND imm8[7] then set #IE;</p>
<p>; end fault reporting</p>
<p>return dest[31:0];</p>
<p>}</p>
<p>; end of FIXUPIMM_SP()</p>
<p><strong>VFIXUPIMMSS (EVEX encoded version)</strong></p>
<p>IF k1[0] OR *no writemask*</p>
<p>THEN DEST[31:0] (cid:197) FIXUPIMM_SP(DEST[31:0], SRC1[31:0], SRC2[31:0], imm8 [7:0])</p>
<p>ELSE</p>
<p>IF *merging-masking*</p>
<p>; merging-masking</p>
<p>THEN *DEST[31:0] remains unchanged*</p>
<p>ELSE  DEST[31:0] (cid:197) 0</p>
<p>; zeroing-masking</p>
<p>FI</p>
<p>FI;</p>
<p>DEST[127:32] (cid:197) SRC1[127:32]</p>
<p>DEST[MAX_VL-1:128] (cid:197) 0</p>
<p>Immediate Control Description:</p>
<svg width="594.00003" viewBox="103.980000 1073414.999980 396.000020 196.740015" height="295.1100225">
<text y="1073443.62953" x="327.72" style="font-size:12.003100pt" lengthAdjust="spacingAndGlyphs" textLength="6.6737236">7</text>
<text y="1073443.62953" x="345.72" style="font-size:12.003100pt" lengthAdjust="spacingAndGlyphs" textLength="6.6737236">6</text>
<text y="1073443.62953" x="363.72" style="font-size:12.003100pt" lengthAdjust="spacingAndGlyphs" textLength="6.6737236">5</text>
<text y="1073443.62953" x="381.72" style="font-size:12.003100pt" lengthAdjust="spacingAndGlyphs" textLength="6.6737236">4</text>
<text y="1073443.62953" x="399.72" style="font-size:12.003100pt" lengthAdjust="spacingAndGlyphs" textLength="6.6737236">3</text>
<text y="1073443.62953" x="417.72" style="font-size:12.003100pt" lengthAdjust="spacingAndGlyphs" textLength="6.6737236">2</text>
<text y="1073443.62953" x="435.72" style="font-size:12.003100pt" lengthAdjust="spacingAndGlyphs" textLength="6.6737236">1</text>
<text y="1073443.62953" x="453.72" style="font-size:12.003100pt" lengthAdjust="spacingAndGlyphs" textLength="6.6737236">0</text>
<rect y="1073431.5" x="338.16" style="fill:rgba(0,0,0,0);stroke:rgb(0,0,0);stroke-width:1pt;" height="18.0" width="17.28"></rect>
<rect y="1073530.5" x="140.16" style="fill:rgba(0,0,0,0);stroke:rgb(0,0,0);stroke-width:1pt;" height="17.22" width="108.0"></rect>
<rect y="1073458.5" x="140.16" style="fill:rgba(0,0,0,0);stroke:rgb(0,0,0);stroke-width:1pt;" height="18.0" width="108.0"></rect>
<rect y="1073494.5" x="140.16" style="fill:rgba(0,0,0,0);stroke:rgb(0,0,0);stroke-width:1pt;" height="18.0" width="108.0"></rect>
<rect y="1073512.5" x="140.16" style="fill:rgba(0,0,0,0);stroke:rgb(0,0,0);stroke-width:1pt;" height="18.0" width="108.0"></rect>
<rect y="1073476.5" x="140.16" style="fill:rgba(0,0,0,0);stroke:rgb(0,0,0);stroke-width:1pt;" height="18.0" width="108.0"></rect>
<rect y="1073547.72" x="140.16" style="fill:rgba(0,0,0,0);stroke:rgb(0,0,0);stroke-width:1pt;" height="18.0" width="108.0"></rect>
<rect y="1073565.72" x="140.16" style="fill:rgba(0,0,0,0);stroke:rgb(0,0,0);stroke-width:1pt;" height="18.0" width="108.0"></rect>
<rect y="1073583.72" x="140.16" style="fill:rgba(0,0,0,0);stroke:rgb(0,0,0);stroke-width:1pt;" height="18.0" width="108.0"></rect>
<path style="stroke:black" d="M320.160000,1073431.500000 L320.160000,1073449.500000 L338.160000,1073449.500000 L338.160000,1073431.500000 "></path>
<path style="stroke:black" d="M320.160000,1073431.500000 L320.160000,1073449.500000 L338.160000,1073449.500000 L338.160000,1073431.500000 "></path>
<path style="stroke:black" d="M355.440000,1073431.500000 L355.440000,1073449.500000 L373.440000,1073449.500000 L373.440000,1073431.500000 "></path>
<path style="stroke:black" d="M355.440000,1073431.500000 L355.440000,1073449.500000 L373.440000,1073449.500000 L373.440000,1073431.500000 "></path>
<path style="stroke:black" d="M373.440000,1073431.500000 L373.440000,1073449.500000 L391.440000,1073449.500000 L391.440000,1073431.500000 "></path>
<path style="stroke:black" d="M373.440000,1073431.500000 L373.440000,1073449.500000 L391.440000,1073449.500000 L391.440000,1073431.500000 "></path>
<path style="stroke:black" d="M391.440000,1073431.500000 L391.440000,1073449.500000 L409.440000,1073449.500000 L409.440000,1073431.500000 "></path>
<path style="stroke:black" d="M391.440000,1073431.500000 L391.440000,1073449.500000 L409.440000,1073449.500000 L409.440000,1073431.500000 "></path>
<path style="stroke:black" d="M409.440000,1073431.500000 L409.440000,1073449.500000 L427.440000,1073449.500000 L427.440000,1073431.500000 "></path>
<path style="stroke:black" d="M409.440000,1073431.500000 L409.440000,1073449.500000 L427.440000,1073449.500000 L427.440000,1073431.500000 "></path>
<path style="stroke:black" d="M427.440000,1073431.500000 L427.440000,1073449.500000 L445.440000,1073449.500000 L445.440000,1073431.500000 "></path>
<path style="stroke:black" d="M427.440000,1073431.500000 L427.440000,1073449.500000 L445.440000,1073449.500000 L445.440000,1073431.500000 "></path>
<path style="stroke:black" d="M445.440000,1073431.500000 L445.440000,1073449.500000 L463.440000,1073449.500000 L463.440000,1073431.500000 "></path>
<path style="stroke:black" d="M445.440000,1073431.500000 L445.440000,1073449.500000 L463.440000,1073449.500000 L463.440000,1073431.500000 "></path>
<path style="stroke:black" d="M325.440000,1073459.220000 L329.160000,1073449.500000 L332.160000,1073459.220000 L325.440000,1073459.220000 "></path>
<path style="stroke:black" d="M343.440000,1073459.220000 L346.440000,1073449.500000 L350.160000,1073459.220000 L343.440000,1073459.220000 "></path>
<path style="stroke:black" d="M361.440000,1073459.220000 L364.440000,1073449.500000 L368.220000,1073459.220000 L361.440000,1073459.220000 "></path>
<path style="stroke:black" d="M379.440000,1073459.220000 L382.440000,1073449.500000 L386.220000,1073459.220000 L379.440000,1073459.220000 "></path>
<path style="stroke:black" d="M397.440000,1073459.220000 L400.440000,1073449.500000 L404.220000,1073459.220000 L397.440000,1073459.220000 "></path>
<path style="stroke:black" d="M415.440000,1073459.220000 L418.440000,1073449.500000 L421.440000,1073459.220000 L415.440000,1073459.220000 "></path>
<path style="stroke:black" d="M433.440000,1073459.220000 L436.440000,1073449.500000 L439.440000,1073459.220000 L433.440000,1073459.220000 "></path>
<path style="stroke:black" d="M451.440000,1073459.220000 L454.440000,1073449.500000 L457.440000,1073459.220000 L451.440000,1073459.220000 "></path>
<path style="stroke:black" d="M248.160000,1073467.500000 L329.160000,1073467.500000 L329.160000,1073458.500000 "></path>
<path style="stroke:black" d="M248.160000,1073485.500000 L346.440000,1073485.500000 L346.440000,1073458.500000 "></path>
<path style="stroke:black" d="M248.160000,1073503.500000 L364.440000,1073503.500000 L364.440000,1073458.500000 "></path>
<path style="stroke:black" d="M248.160000,1073521.500000 L382.440000,1073521.500000 L382.440000,1073458.500000 "></path>
<path style="stroke:black" d="M248.160000,1073539.500000 L400.440000,1073539.500000 L400.440000,1073458.500000 "></path>
<path style="stroke:black" d="M248.160000,1073557.500000 L418.440000,1073557.500000 L418.440000,1073458.500000 "></path>
<path style="stroke:black" d="M248.160000,1073574.720000 L436.440000,1073574.720000 L436.440000,1073458.500000 "></path>
<path style="stroke:black" d="M248.160000,1073592.720000 L454.440000,1073592.720000 L454.440000,1073458.500000 "></path>
<rect y="1073431.5" x="338.16" style="fill:rgba(0,0,0,0);stroke:rgb(0,0,0);stroke-width:1pt;" height="18.0" width="17.28"></rect>
<rect y="1073530.5" x="140.16" style="fill:rgba(0,0,0,0);stroke:rgb(0,0,0);stroke-width:1pt;" height="17.22" width="108.0"></rect>
<text y="1073543.59443" x="158.16" style="font-size:12.003100pt" lengthAdjust="spacingAndGlyphs" textLength="37.20000752">ONE  (cid:198)</text>
<text y="1073543.59443" x="219.6603" style="font-size:12.003100pt" lengthAdjust="spacingAndGlyphs" textLength="22.20093376">#IE</text>
<rect y="1073458.5" x="140.16" style="fill:rgba(0,0,0,0);stroke:rgb(0,0,0);stroke-width:1pt;" height="18.0" width="108.0"></rect>
<text y="1073471.59443" x="149.16" style="font-size:12.003100pt" lengthAdjust="spacingAndGlyphs" textLength="41.69636878">+ INF (cid:198)</text>
<text y="1073471.59443" x="219.6602" style="font-size:12.003100pt" lengthAdjust="spacingAndGlyphs" textLength="22.20093376">#IE</text>
<rect y="1073494.5" x="140.16" style="fill:rgba(0,0,0,0);stroke:rgb(0,0,0);stroke-width:1pt;" height="18.0" width="108.0"></rect>
<text y="1073507.59443" x="149.16" style="font-size:12.003100pt" lengthAdjust="spacingAndGlyphs" textLength="41.69636878">- INF (cid:198)</text>
<text y="1073507.59443" x="219.6602" style="font-size:12.003100pt" lengthAdjust="spacingAndGlyphs" textLength="22.20093376">#IE</text>
<rect y="1073512.5" x="140.16" style="fill:rgba(0,0,0,0);stroke:rgb(0,0,0);stroke-width:1pt;" height="18.0" width="108.0"></rect>
<text y="1073525.59443" x="154.44" style="font-size:12.003100pt" lengthAdjust="spacingAndGlyphs" textLength="37.20000752">SNaN (cid:198)</text>
<text y="1073525.59443" x="219.66" style="font-size:12.003100pt" lengthAdjust="spacingAndGlyphs" textLength="22.20093376">#IE</text>
<rect y="1073476.5" x="140.16" style="fill:rgba(0,0,0,0);stroke:rgb(0,0,0);stroke-width:1pt;" height="18.0" width="108.0"></rect>
<text y="1073489.59443" x="149.16" style="font-size:12.003100pt" lengthAdjust="spacingAndGlyphs" textLength="7.20186">-</text>
<text y="1073489.59443" x="164.94047557" style="font-size:12.003100pt" lengthAdjust="spacingAndGlyphs" textLength="29.69686971">VE  (cid:198)</text>
<text y="1073489.59443" x="219.6602" style="font-size:12.003100pt" lengthAdjust="spacingAndGlyphs" textLength="22.20093376">#IE</text>
<rect y="1073547.72" x="140.16" style="fill:rgba(0,0,0,0);stroke:rgb(0,0,0);stroke-width:1pt;" height="18.0" width="108.0"></rect>
<text y="1073560.81443" x="158.16" style="font-size:12.003100pt" lengthAdjust="spacingAndGlyphs" textLength="37.20000752">ONE  (cid:198)</text>
<text y="1073560.81443" x="219.6603" style="font-size:12.003100pt" lengthAdjust="spacingAndGlyphs" textLength="22.20093376">#ZE</text>
<rect y="1073565.72" x="140.16" style="fill:rgba(0,0,0,0);stroke:rgb(0,0,0);stroke-width:1pt;" height="18.0" width="108.0"></rect>
<text y="1073578.81443" x="154.44" style="font-size:12.003100pt" lengthAdjust="spacingAndGlyphs" textLength="37.20000752">ZERO (cid:198)</text>
<text y="1073578.81443" x="219.66" style="font-size:12.003100pt" lengthAdjust="spacingAndGlyphs" textLength="22.20093376">#IE</text>
<rect y="1073583.72" x="140.16" style="fill:rgba(0,0,0,0);stroke:rgb(0,0,0);stroke-width:1pt;" height="18.0" width="108.0"></rect>
<text y="1073596.81443" x="154.44" style="font-size:12.003100pt" lengthAdjust="spacingAndGlyphs" textLength="37.20000752">ZERO (cid:198)</text>
<text y="1073596.81443" x="219.66" style="font-size:12.003100pt" lengthAdjust="spacingAndGlyphs" textLength="22.20093376">#ZE</text></svg>
<h3>Figure 5-12.  VFIXUPIMMSS Immediate Control Description</h3>
<p><strong>Intel C/C++ Compiler Intrinsic Equivalent</strong></p>
<p>VFIXUPIMMSS __m128 _mm_fixupimm_ss( __m128 a, __m128i tbl, int imm);</p>
<p>VFIXUPIMMSS __m128 _mm_mask_fixupimm_ss(__m128 s, __mmask8 k, __m128 a, __m128i tbl, int imm);</p>
<p>VFIXUPIMMSS __m128 _mm_maskz_fixupimm_ss( __mmask8 k, __m128 a, __m128i tbl, int imm);</p>
<p>VFIXUPIMMSS __m128 _mm_fixupimm_round_ss( __m128 a, __m128i tbl, int imm, int sae);</p>
<p>VFIXUPIMMSS __m128 _mm_mask_fixupimm_round_ss(__m128 s, __mmask8 k, __m128 a, __m128i tbl, int imm, int sae);</p>
<p>VFIXUPIMMSS __m128 _mm_maskz_fixupimm_round_ss( __mmask8 k, __m128 a, __m128i tbl, int imm, int sae);</p>
<p><strong>SIMD Floating-Point Exceptions</strong></p>
<p>Zero, Invalid</p>
<p><strong>Other Exceptions</strong></p>
<p>See Exceptions Type E3.</p></body></html>